const jwt = require('jsonwebtoken')
const privateKey = 'shhhhh'
//使用jwt进行加密
var token = jwt.sign({ foo: 'bar' }, privateKey,{expiresIn:3});

console.log(token,'| token')

//使用jwt进行解密
setTimeout(() => {
    let obj = jwt.verify(token, privateKey);
    console.log(obj);
}, 4000);